#include "querywin.h"
#include "ui_querywin.h"

QueryWin::QueryWin(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::QueryWin)
{
    ui->setupUi(this);
    model = new QSqlTableModel();
}

QueryWin::~QueryWin()
{
    delete ui;
}

void QueryWin::on_queryBtn_clicked()
{
    if(ui->eplRb->isChecked())
    {
        //显示员工信息
        model->setTable("employee");
    }
    else if(ui->atdRb->isChecked())
    {
        model->setTable("attendance");
    }

    model->select();


    //这里可以加过滤器
    ui->tbView->setModel(model);
}
